package com.chao.demo.bean;

import lombok.Data;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;

@Data
// @AllArgsConstructor
// @NoArgsConstructor
public class Scheduled {

    private int cronId;
    private String cronName;
    private String cron;
    private String remark;

    public Scheduled(int cronId) {
        this.cronId = cronId;
    }

    public  Scheduled(){

    }

    public static void main(String[] args)  {
        /**
         * 请编写一个Java程序，要求实现以下功能：读入一个字符串，统计并输出其中字母 非重复字符串个数
         * 例:
         * aabbcdd
         * 答案1
         */
        ArrayList<Object> list = new ArrayList<>();
        Scanner in = new Scanner(System.in);
        System.out.println("请输入字符串:");
        String str = in.next();
        HashSet<Object> set1 = new HashSet<>();
        HashSet<Object> set2 = new HashSet<>();

        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if(set1.contains(ch)){
                set2.add(ch);
            }else {
                set1.add(ch);
            }
        }
        set1.removeAll(set2);
        System.out.println(set1.size());
    }
}
